package com.wenli.lt.controller;


import com.wenli.lt.entity.Commentlist;
import com.wenli.lt.entity.Information;
import com.wenli.lt.service.ICommentlistService;
import com.wenli.lt.util.CommonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lt
 * @since 2021-03-23
 */
@RestController
@Api(tags="评论")
@RequestMapping("commentlist")
public class CommentlistController {
    @Autowired
    ICommentlistService commentlistService;
    @PostMapping("AddCommentlist")

    @ApiOperation("评论")
    public CommonResponse AddCommentlist(@RequestBody @ApiParam(name = "commentlist",value = "评论") Commentlist commentlist){
        Boolean aBoolean = commentlistService.AddCommentlist(commentlist);
        if(aBoolean){
            return new CommonResponse("评论成功!");
        }else {
            return new CommonResponse(CommonResponse.ERROR_CODE,"数据出错,请联系管理员");
        }
    }

}
